<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="generator" content="" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link href="css/haiersoft.css" rel="stylesheet" type="text/css" media="screen,print" />
<link href="css/print.css" rel="stylesheet" type="text/css"  media="print" />
<script src="js/jquery-1.10.1.min.js"></script>
<script src="js/side.js" type="text/javascript"></script>

<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->
</head>

<body>
<form class="form-inline definewidth m20" action="major/queryByName_Major" method="post" id="pager">    
专业名称：<input type="text" name="mname" id="mname" 
    class="abc input-default" placeholder="" value="${mname}">&nbsp;&nbsp; 
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; <button type="button" class="btn btn-success" id="addnew" >新增专业</button>
</form>

<!-- MainForm -->
<div id="MainForm">
<div class="form_boxA">
<h2>年度预算列表</h2>
<table cellpadding="0" cellspacing="0">
	<tr>
		<th>专业编号</th>
  		<th>专业名称</th>
  		<th>专业价格</th>
  		<th>教学费</th>
  		<th>住宿费</th>
  		<th>学杂费</th>
  		<th>专业详情</th>
  		<th>父类id</th>
  		<th>操作</th>
	</tr>
	<c:forEach var="m" items="${pageModel }">
		<c:if test="${m.fatherid==0 }">
			<tr>
			  	<td bgcolor="#F1F1F1">${m.mid }</td>
			  	<td>${m.mname }</td>
			  	<td>${m.mprice }</td>
			  	<td>${m.tprice }</td>
			  	<td>${m.aprice }</td>
			  	<td>${m.lprice }</td>
			  	<td>${m.mdecx }</td>	
			  	<td>${m.fatherid }</td>	
			  	<td><a href="major/add_Major?mid=${m.mid }">编辑</a> | <a href="javascript:del(${m.mid });">删除</a></td>
			</tr>
		</c:if>
		<c:forEach items="${pageModel }" var="small">
			<c:if test="${small.fatherid==m.mid }">
				<tr>
				  	<td>${small.mid }</td>
				  	<td>${small.mname }</td>
				  	<td>${small.mprice }</td>
				  	<td>${small.tprice }</td>
				  	<td>${small.aprice }</td>
				  	<td>${small.lprice }</td>
				  	<td>${small.mdecx }</td>	
				  	<td>${small.fatherid }</td>
				  	<td><a href="major/add_Major?mid=${small.mid }">编辑</a> | <a href="javascript:del(${small.mid });">删除</a></td>
				</tr>
			</c:if>
		</c:forEach>
		
		
	</c:forEach>
</table>
<%-- <div class="inline pull-right page">
	<%@include file="../../pageBar.jsp" %>
</div> --%>
</div>
</div>
<!-- /MainForm -->

</body>
</html>
<script>
    $(function () {
		$('#addnew').click(function(){
				window.location.href="major/add_Major";
		 });
    });
    $(function () {
		$('#syno').click(function(){
				window.location.href="sys/user_syno";
		 });
    });
	function del(id){
		if(confirm("确定要删除吗？")){
			var url = "major/delete_Major?mid="+id;
			window.location.href=url;		
		}
	}
</script>